<?php
	/*
        DreamCMS Version 1.0
		Developed by: Andrei Mikalov (Zeus)
		
		Thanks to Adam Davis
		Also thanks to Jonas Laursen (PeaceDealer) for coding snippets.
	*/
		
	require_once("models/config.php");
	$pagename= "User Profile"
?>

<?php include("layout_inc/header.php"); ?>
<div id="content_main">
           <?php

        function clean($str){
                return mysql_real_escape_string(strip_tags(stripslashes($str)));
        }
 
        if(isset($_GET['id'])) {
                $id = clean($_GET['id']);
        } else {
                die("ID not set");
        }
 
        $sql = mysql_query("SELECT * FROM DreamCMS_Users WHERE `User_ID` = '$id'");
 
        $rows = mysql_num_rows($sql);
 
        if($rows == 0) {
                die("User not found");
        } else {
                $row = mysql_fetch_assoc($sql);
               
                $id = $row['User_ID'];
                $username = $row['Username'];
                $email = $row['Email'];
                $group = $row['Group_ID'];
                $signupdate = $row['SignUpDate'];
               
                echo "
                <h3>$username's Profile:</h3>
				<fieldset><legend><strong>User Details</strong></legend>
				<p>
                <label>ID:</label> <br>
				&nbsp;&nbsp;&nbsp;$id
				</p>
				<p>
                <label>Email:</label> <br>
				&nbsp;&nbsp;&nbsp;$email
				</p>
				<p>
                <label>Rank:</label> <br>
				&nbsp;&nbsp;&nbsp;$group
				</p>
				<p>
                <label>Registration Date:</label> <br>
				&nbsp;&nbsp;&nbsp;$signupdate
				</p>
                ";     
        }
 
?>
        </div>
    
    <div id="nav_main">
        <h4>Navigation</h4>
        <ul>
          <?php include("layout_inc/right-nav.php"); ?>
        </ul>
    </div>
    
    
</div>

<?php include("layout_inc/footer.php"); ?>

</body>
</html>
